<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type='text/javascript' src='http://localhost/hdphp/hdphp/../hdjs/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/HDPHP_CMS';
		WEB = 'http://localhost/HDPHP_CMS/index.php';
		URL = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details&m=index&aid=6';
		HDPHP = 'http://localhost/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/hdphp/hdphp/Extend';
		APP = 'http://localhost/HDPHP_CMS/index.php?a=Index';
		CONTROL = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details';
		METH = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details&m=index';
		GROUP = 'http://localhost/HDPHP_CMS/./Cms';
		TPL = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1';
		CONTROLTPL = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1/Details';
		STATIC = 'http://localhost/HDPHP_CMS/Static';
		PUBLIC = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1/Public';
		HISTORY = 'http://localhost/HDPHP_CMS/index.php?a=Admin&c=Article&m=index';
		HTTPREFERER = 'http://localhost/HDPHP_CMS/index.php?a=Admin&c=Article&m=index';
		TEMPLATETPL = 'http://localhost/HDPHP_CMS/Templates/default1';
</script>
<script type="text/javascript">
	$(function(){
		$.ajax({
			url : APP + '&c=Details&m=get_commend&aid=<?php echo $article['aid'];?>',
			dataType:'json',
			beforeSend :function(){
						$('#loading').show();
					},
			success:function(data){
				$('#loading').hide();
				$.each(data, function(index, val) {
					$('#comment-form-box').prepend(" <ul class='position comtext'><li>用户名："+val.nickname+"</li><li>评论内容:"+val.comcon+"</li>");
				});
			},
		})
	})
</script>		

<script type="text/javascript">
	$(function(){
		$("#commentForm").submit( function () {
			var data = $('form[name=comment_form]').serialize();
			$.ajax({
				url:APP+'&c=Details&m=comment&aid=<?php echo $article['aid'];?>',
				data : data,
	            type : 'post',
	            dataType : 'text',
	            beforeSend :function(){
						$('#loading').show();
					},
				success:function(data){
					// alert(typeof data);
					// $('#loading').hide();
					if(data != NULL){
						// var num=parseInt($('#all_comment').html())+1;
						$('#comment-form-box').prepend(data);
						// $('#all_comment').html(num);
					}else{
						alert('评论内容不能为空!')
					}					
				}
			})
		} );
	})
</script>
<link rel="stylesheet" href="http://localhost/HDPHP_CMS/Templates/default1/css/page.css" />
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><link rel="stylesheet" href="http://localhost/HDPHP_CMS/Templates/default1/css/style.css" />
<script type='text/javascript' src='http://localhost/hdphp/hdphp/../hdjs/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdphp/hdphp/../hdjs/css/hdjs.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/../hdjs/js/hdjs.js'></script>
<script src='http://localhost/hdphp/hdphp/../hdjs/js/slide.js'></script>
<script src='http://localhost/hdphp/hdphp/../hdjs/org/cal/lhgcalendar.min.js'></script>
<script type='text/javascript'>
		HOST = 'http://localhost';
		ROOT = 'http://localhost/HDPHP_CMS';
		WEB = 'http://localhost/HDPHP_CMS/index.php';
		URL = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details&m=index&aid=6';
		HDPHP = 'http://localhost/hdphp/hdphp';
		HDPHPDATA = 'http://localhost/hdphp/hdphp/Data';
		HDPHPTPL = 'http://localhost/hdphp/hdphp/Lib/Tpl';
		HDPHPEXTEND = 'http://localhost/hdphp/hdphp/Extend';
		APP = 'http://localhost/HDPHP_CMS/index.php?a=Index';
		CONTROL = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details';
		METH = 'http://localhost/HDPHP_CMS/index.php?a=Index&c=Details&m=index';
		GROUP = 'http://localhost/HDPHP_CMS/./Cms';
		TPL = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1';
		CONTROLTPL = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1/Details';
		STATIC = 'http://localhost/HDPHP_CMS/Static';
		PUBLIC = 'http://localhost/HDPHP_CMS/./Cms/Cms/Index/Tpl/default1/Public';
		HISTORY = 'http://localhost/HDPHP_CMS/index.php?a=Admin&c=Article&m=index';
		HTTPREFERER = 'http://localhost/HDPHP_CMS/index.php?a=Admin&c=Article&m=index';
		TEMPLATETPL = 'http://localhost/HDPHP_CMS/Templates/default1';
</script>
<script type="text/javascript" src="http://localhost/HDPHP_CMS/Templates/default1/js/js.js"></script>
</head>
<body>
	<!-- 顶部100%灰色区域 -->
	<div id="top_dark_box">
		<!-- 中间1200px宽度区域 -->
		<div id="top_dark">
			<a href="http://localhost/HDPHP_CMS"><img src="http://localhost/HDPHP_CMS/Templates/default1/images/others/logo.jpg" id="logo" /></a>
			<!-- 导航菜单 -->
			<ul id="menu">
				<li>
					<a href="http://localhost/HDPHP_CMS" >首页</a>
				</li>
						<?php
		$data=K('Category')->where('is_show=1')->order('cid ASC')->limit(10)->findAll();
		?>
		<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
			$field['url']=get_cate_url($field['is_listhtml'],$field['htmldir'],$field['cid'])
			?>
			
					<li>
						<a href="<?php echo $field['url'];?>" ><?php echo $field['cname'];?></a>
					</li>
				
		<?php }?><?php endif;?>
			</ul>
			<!-- 导航菜单结束 -->
			<!-- 用户登录 -->
			<div id="loginInfo" class='loginInfo'>
				
			</div>
			<!-- 用户登录对应隐藏区域 -->
			<form id="loginForm" action="<?php echo U('Index/Login/login');?>" method="post">
			<div class="login_hide_box">
				<img src="http://localhost/HDPHP_CMS/Templates/default1/images/sanjiao.gif" alt="" />
				<div class="middle">
					<p>用户名：</p>
					<input type="text" name="username" class="text" />
					<p>密码：</p>
					<input type="password" name="password" class="text" />
					<input type="submit" value="" class="sub" />
				</div>
				<div class="bottom">
					<a  href="javascript:showRegBox();" class="reg">注册</a>
				</div>
			</div>
			</form>
			
			<!-- 用户注册对应隐藏区域 -->
			<form id="regForm" action="<?php echo U('Index/Register/reg');?>" method="post">	
			<div class="reg_hide_box">
				<img src="http://localhost/HDPHP_CMS/Templates/default1/images/sanjiao.gif" alt="" />
				<div class="middle">
					<p>用户名：</p>
					<input type="text" name="username_reg" class="text username" />
					<p>昵称：</p>
					<input type="text" name="nickname" class="text nickname" />
					<p>密码：</p>
					<input type="password" name="password_reg1" class="text password" />
					<p>确认密码：</p>
					<input type="password" name="password_reg2" class="text password" />
					<p>验证码：</p>
					<img src="<?php echo U('Index/Register/code');?>" id="code" onclick="this.src=this.src + '&' + Math.random()"/>
					<input type="text"  name="code" class="text password_d" />
					<input type="submit" value="注册" class="sub" />
				</div>
			</div>
			</form>
		</div>
		<!-- 中间1200px宽度区域结束 -->
	</div>
	<!-- 顶部灰色100%区域结束 -->
	
	<!-- 顶部最新消息区域 -->
	<div id="latest_news_box">
		<div id="latest_news">
			<p><span class="title">最新消息：</span>大前端是一个关注web前端开发、用户体验设计、wordpress主题、前端招聘信息的站点</p>
		</div>
	</div>
	<!-- 顶部最新消息区域结束 -->
	<!-- 主体区域 -->
	<div id="page_main">
		<!-- 右侧 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div class="right">
			<div class='hd_title'>
				<strong>标签云</strong>	
			</div>
			<div id="tagBox" class='tags'>
					<?php
		$data=K('Tag')->limit('10')->get_data();
		?>
		<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
		<?php 
			$field['url'] = U('List/index',array('tid'=>$field['tid']))
		?>
		
				<a href="<?php echo $field['url'];?>"><?php echo $field['tagname'];?></a>
			
		<?php }?><?php endif;?>
			</div>
			<div class='hd_title'>
				<strong>热门文章</strong>	
			</div>
			<ul class='arc_list'>
			<?php			$data=K('ArticleView')->limit(4)->where('attr like "%热门%"')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=get_arc_url($field['is_archtml'],$field['htmldir'],$field['aid']);
			?>
			
				<li>
					<div class='image'>
						<a href="<?php echo $field['url'];?>">
							<img src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>"/>
						</a>
					</div>
					<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?></a></h2>
					<p>
						<em><?php echo date('m-d',$field['sendtime']);?></em><em><span id="click"><script type="text/javascript" src="<?php echo U('Index/Details/get_statics_click',array('aid'=>$field['aid']));?>"></script></span>次浏览</em>
					</p>
				</li>
			
			<?php }?><?php endif;?>
			</ul>
			<div class='hd_title'>
				<strong>推荐文章</strong>	
			</div>
			
			<ul class='arc_list'>
			<?php			$data=K('ArticleView')->limit(2)->where('attr like "%推荐%"')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=get_arc_url($field['is_archtml'],$field['htmldir'],$field['aid']);
			?>
			
				<li>
					<div class='image'>
						<a href="<?php echo $field['url'];?>">
							<img src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>"/>
						</a>
					</div>
					<h2><a href=""><?php echo $field['title'];?></a></h2>
					<p>
						<em><?php echo date('m-d',$field['sendtime']);?></em><em><span id="click"><script type="text/javascript" src="<?php echo U('Index/Details/get_statics_click',array('aid'=>$field['aid']));?>"></script></span>次浏览</em>
					</p>
				</li>
			
			<?php }?><?php endif;?>
			</ul>
		</div>
		<!-- 右侧结束 -->
		<!-- 左侧 -->
		<div class="left">
			<h1><?php echo $article['title'];?></h1>
			<!-- 文章信息 -->
			<div class="article_info_box">
				<p class="article_info">
					<span class="padding_right"><?php echo date('m-d',$article['sendtime']);?></span>
					分类：<a href="<?php echo $field['url'];?>" class="padding_right"><?php echo $article['cname'];?></a>
					<a href="javascript:" class="padding_right comment">
						<span style="color:#0088DB" id="all_comment"><script type="text/javascript" src="<?php echo U('Index/Details/commend_num',array('aid'=>$article['aid']));?>"></script></span>条评论		
					</a>
					<span id="click"><script type="text/javascript" src="<?php echo U('Index/Details/get_click',array('aid'=>$article['aid']));?>"></script></span>次浏览
				</p>
			</div>
			<!-- 文章信息结束 -->

			<!-- 文章内容区域 -->
			<div class="article_content">
				<?php echo $article['content'];?>
			</div>
			<!-- 文章内容区域结束 -->

			<p class="position">当前位置：<a href="<?php echo $field['url'];?>"><?php echo $article['cname'];?></a> » <a href=""><?php echo $article['title'];?></a></p>
			<p class="tags">
				继续浏览有关
				<!-- //标签 -->
				<a href="">PHP</a><a href="">JS</a>
				的文章</p>
			<!-- 相关文章 -->
			<p class="tags" style="border-bottom: 1px solid #EEEEEE;padding-bottom:10px;width:780px;">
				<span style="font-size:18px;float:left;">全部评论</span>
				<span id="loading">
					<img src="http://localhost/HDPHP_CMS/Templates/default1/images/loading.gif" style='width:25px;height:25px;'>
				</span>
			</p>
			<div id="comment-form-box" style="width:780px;height:300px;overflow:auto">

				<!-- <ul class="position comtext">
					<li>
						用户名：<?php echo $field['user_uid'];?>
					</li>
					<li>
						评论内容:<?php echo $field['comcon'];?>
					</li>
				</ul> -->
			</div>
			<p class="tags"><span style="font-size:18px;float:left;">我来评论</span><!-- <span style="font-size:13px;float:right;color:#1A649D"><i style="font-style:normal;color:#1A649D">70</i>条评论</span> --></p>
			<div id="comment-form-box">
				<form id="commentForm" action="javascript:" method="post" name="comment_form">
					<textarea id="comment_content" name="comcon"></textarea>
					<input class='submit' type="submit" value="发表评论">
				</form>
			</div>	
		</div>
	<!-- 主体区域结束 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?>	<!-- 底部浅灰色导航区域 -->
	<div id="bottom_menu_box" style="margin-top:30px;">
		<div class="bottom_menu">
				<?php
		$data=K('Flink')->limit()->where('is_show=1')->order('sort ASC')->get_data();
		?>
		<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
		<?php 
			$field['logo']='http://localhost/HDPHP_CMS/'.$field['logo'];
		?>
		
			<dl>
				<dt><a href="<?php echo $field['url'];?>" target="_blank"><?php echo $field['fname'];?></a></dt>
			</dl>
		
		<?php }?><?php endif;?>
		</div>
	</div>
	<!-- 底部浅灰色导航区域结束 -->

	<!-- 底部版权区域 -->
	<div id="bottom_copyright_box">
		<div class="bottom_copyright">
			版权信息
		</div>
	</div>
	<!-- 底部版权区域结束 -->
	
</body>
</html>
